<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/layouts/include/taglib.jsp" %>
<c:set var="ctx" value="${pageContext.request.contextPath}"/> 

<!DOCTYPE html>
<html lang="zh-cn">
<head>
<meta charset="utf-8">
<meta name="decorator" content="default" />
</head>


<body>
	<div class="row">
		<div class="tabbable col-sm-12">
				<ul id="myTab" class="nav nav-tabs">
					<li class="active">
						<a href="#home" data-toggle="tab">
							
							项目详细信息
						</a>
					</li>
					<li>
						<a href="#profile" data-toggle="tab">
							项目修改记录
						</a>
					</li>
					
				</ul>
				<div class="tab-content" >
					<div id="home" class="tab-pane in active">
						 <div id="tdone" class="col-sm-12">
							<div class="col-xs-4">
								<div class="col-xs-4">
									<label>项目名称；</label>
								</div>
								
								<div class="col-xs-8">
									<label id="prjName"></label>
								</div>
								
							</div>
							<div class="col-xs-4">
								<div class="col-xs-4">
									<label>项目类型：</label>
								</div>
								
								<div class="col-xs-8">
									<label id="prjType"></label>
								</div>

							</div>
							<div class="col-xs-4">
								<div class="col-xs-4">
									<label>项目级别：</label>
								</div>
								
								<div class="col-xs-8">
									<label id="prjLvl"></label>
								</div>

							</div>
							
							<div class="col-xs-4">
								<div class="col-xs-4">
									<label >开始日期：</label>
								</div>
								
								<div class="col-xs-8">
									<label id="startDate"></label>
								</div>
								
							</div>
							<div class="col-xs-4">
								<div class="col-xs-4">
									<label >结束日期：</label>
								</div>
								
								<div class="col-xs-8">
									<label id=endDate>sf</label>
								</div>
								
							</div>
							<div class="col-xs-4">
								<div class="col-xs-4">
									<label>项目规模：</label>
								</div>
								
									<div class="col-xs-8">
										<label id="projectSize">sf</label>
								</div>
								
							</div>
							<div class="col-xs-4">
								<div class="col-xs-4">
									<label >客户号：</label>
								</div>
								
								<div class="col-xs-8">
									<label id="custNo">sf</label>
								</div>
								
							</div>
							<div class="col-xs-4">
								<div class="col-xs-4">
									<label >状态：</label>
								</div>
									
								<div class="col-xs-8">
									<label id="status"></label>
								</div>
								
							</div>
							<div class="col-xs-4">
								<div class="col-xs-4">
									<label>描述：</label>
								</div>
								
								<div class="col-xs-8">
									<label id="depict">sf</label>
								</div>
								
							</div>
						</div>

						<br>
						<br>
						<br>
						<br>
						<br>
						<br>
						<br>
						<br>
					</div>
					<!-- 查看修改记录 要弄成一个表格 -->
					<div id="profile" class="tab-pane">
						<div class="col-xs-12">
							<div class="table-responsive">
								<table id="prjTable" class="table table-striped table-bordered table-hover">
									<thead>
										<tr>
											<th width="10%">项目名称</th>
											<th width="10%">项目类型</th>
											<th width="10%">项目级别</th>
											<th width="10%">开始时间</th>
											<th width="10%">结束时间</th>
											<th width="10%">项目规模</th>
											<th width="10%">客户编号</th>
											<th width="10%">项目状态</th>
											<th width="10%">项目描述</th>
										</tr>
									</thead>
									<tbody>
									</tbody>
								</table>
							</div>
						</div>
						<br>
						<br>
						<br>
						<br>
						<br>
						<br>
						<br>
						<br>
					</div>
					
				</div>
			</div>
		</div>
	</div>
	
	
<script type="text/javascript">
	$(document).ready(function(){
		queryPrj();
	})
	
	//查询项目详细信息
	function queryPrj(){
		var id="c21fa5dd7e5b4sf0bb8f8b081b2f0eb0";
		 Otod.ajax({
			url:"${ctx}/pm/project/getprojectById.do?id="+id,
			//没有设置默认data不能使用
			//data:{id:id},
			successFn:function(data){
				$('#prjName').html(data.prjName);
				//下拉框赋值 把id值  更改为 #selectChange
				$('#prjType').html(changType(data.prjType));
				$('#prjLvl').html(data.prjLvl);
				$('#projectSize').html(data.projectSize);
				$('#custNo').html(data.custNo);
				//项目开始日期
				$('#startDate').html(transformDate(data.startDate));
				//项目结束日期
				$('#endDate').html(transformDate(data.endDate));

				$('#status').html(transFormStatus(data.status));
				$('#depict').html(data.depict);
				//Otod.Msg.info("查询成功成功！");
			}
		}) 
	}
	//查询修改记录 没有表暂时没有做
	function updateRecord(uuid){
		
	}
	
	//由于后台的这个方法多次使用 如果在后台转换 会出问题
	function changType(prjType){
		if(prjType==1){
			return "景观设计"
		}else if(prjType==1){
			return "旅游规划"
		}else if(prjType==1){
			return "土地规划"
		}else if(prjType==1){
			return "建筑设计"
		}
		
	}
	
	//将毫秒数转成日期
	function transformDate(oldTime){
		if(oldTime==null){
			return "";
		}else{
			var d=new Date(oldTime);
			var year=d.getFullYear();
			var day=d.getDate();
			var month=+d.getMonth()+1;
			var hour=d.getHours();
			var minute=d.getMinutes();
			var second=d.getSeconds();
			var misec=d.getMilliseconds();
			var f=year+"-"+month+"-"+day;
			return f;
		}
	}
	//转换状态
	function transFormStatus(status){
		if(prjType==22190001){
			return "准备中"
		}else if(status==22190002){
			return "进行中"
		}else if(status==22190003){
			return "中止"
		}else if(status==22190004){
			return "结项"
		}
	}
</script>
</body>
</html>